UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XbeGZq+G05pS4Y82gaeRO1VHXuYoTgpahi9s1jyjrYg=' 
WHERE 
  key_id = '201cfe2f26218d2e0885653566779aed191ee7b68df2645720978595623bf007' 
  AND (
    token = 'XbeGZq+G05pS4Y82gaeRO1VHXuYoTgpahi9s1jyjrYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022