UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0tktkTwdXCRLLj5eYubA7hqpXBqFx4zxINfYJ8PqYME=' 
WHERE 
  key_id = '1ea4e5c2d7e8bb1f99fb5261c143af483e683e3f0740a1657b74a92cdea73648' 
  AND (
    token = '0tktkTwdXCRLLj5eYubA7hqpXBqFx4zxINfYJ8PqYME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038