UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd6axMBb2yqnET5GwqaRksrzIfLPNaTfBESyHHhDZjB4=' 
WHERE 
  key_id = 'b7219468fc71fecfbe2db72efed5241e092bc2c14e3bfe653ea6d0e9e53c250c' 
  AND (
    token = 'd6axMBb2yqnET5GwqaRksrzIfLPNaTfBESyHHhDZjB4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044