UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yY8rFWrHQyyM8wQPdu+wh/utdzahZN7tZYLbhLl0rf0=' 
WHERE 
  key_id = '354c4fda8f5f5383de9ecb256abcfc6dc26b2536697886a03171a692db2c93fb' 
  AND (
    token = 'yY8rFWrHQyyM8wQPdu+wh/utdzahZN7tZYLbhLl0rf0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032