UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rjDGNJ5O8LO6oMPs5FwB9JY3GMjWvmPBpXCDAGsZJms=' 
WHERE 
  key_id = '0fe29a2eb6316ab6148d54928577d73de55f254f1258e0b98f1c57906d76ba39' 
  AND (
    token = 'rjDGNJ5O8LO6oMPs5FwB9JY3GMjWvmPBpXCDAGsZJms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024