UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+JyWh8W116e5qeVhJgbRhmxpbXxYQ6k8utjQ6B7zxvA=' 
WHERE 
  key_id = '04b8b5029fbd3d450e264fad2adc20d57e319dda45beb04a26b22ed49558ead7' 
  AND (
    token = '+JyWh8W116e5qeVhJgbRhmxpbXxYQ6k8utjQ6B7zxvA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028