UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gx1gwJNLhbRhXcjVoHMyPfIK0r0ZTFtHfMJZnzjKq/g=' 
WHERE 
  key_id = '5d9ed1896c4549cb3648dd7171e60e544e2d177ca80856aa17fda895eaed20c7' 
  AND (
    token = 'gx1gwJNLhbRhXcjVoHMyPfIK0r0ZTFtHfMJZnzjKq/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034