UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ikhlvoyqrURvdgORSmc8Y7pe83Tr2KIkik0aT92rW8=' 
WHERE 
  key_id = 'fae6b1ff148ea1afbc3810a58b8b6b27ad05499f23857f73050f7979a5baa62e' 
  AND (
    token = '/ikhlvoyqrURvdgORSmc8Y7pe83Tr2KIkik0aT92rW8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026