UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mjvZRbzLTj9sUXB/kEc9IjAetoClc+IK3o/F3cknv+M=' 
WHERE 
  key_id = 'e1da9c750ceced125d866e6f7d11b4a6472e92491efbb9e27db6b655a8863199' 
  AND (
    token = 'mjvZRbzLTj9sUXB/kEc9IjAetoClc+IK3o/F3cknv+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019