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

Query time 0.00033