UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T41hVzhkRyngripTz19S2Zi9aDYVGurL+gtIazVwUp0=' 
WHERE 
  key_id = 'e5ae4541e20f2cb1f44fdab3fd3bb7860c2e4053899d0ed8403b8373e57528b5' 
  AND (
    token = 'T41hVzhkRyngripTz19S2Zi9aDYVGurL+gtIazVwUp0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035