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

Query time 0.00031