UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o8Th65OiQaTdPqf9jt/RIAMKGgUcEfKCJboKHqjghok=' 
WHERE 
  key_id = '15d806dbba6ec78aca7b9238fe6ff129e7fc0e01d3a0eb08bcc065920e0643bf' 
  AND (
    token = 'o8Th65OiQaTdPqf9jt/RIAMKGgUcEfKCJboKHqjghok=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030