UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v6p4T0/s18svWbIpx9p2m3Tb2uuX6sPL0VWuAuMOk6s=' 
WHERE 
  key_id = '8eca3f6e593c66fa82556ff384088298458caad932e88cd9e293f2643bac19ad' 
  AND (
    token = 'v6p4T0/s18svWbIpx9p2m3Tb2uuX6sPL0VWuAuMOk6s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038