UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NTK9cKcl5NEu8XushMUQEKD7kkN1pxHgh0nmHTDoP7Y=' 
WHERE 
  key_id = '5a556e39809a5ef7a43d1096e2926a8129999382bc8d7fb8a58d8541790d89cd' 
  AND (
    token = 'NTK9cKcl5NEu8XushMUQEKD7kkN1pxHgh0nmHTDoP7Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031