UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fmv42YSBcJQhzUIU2JQQRuD6AzEDhf8w0GusEbCpWQI=' 
WHERE 
  key_id = 'f95234df07c4d04d2e361e26d703b9cc6b6de07dca465487c5a740fcd40b3d40' 
  AND (
    token = 'fmv42YSBcJQhzUIU2JQQRuD6AzEDhf8w0GusEbCpWQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033