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

Query time 0.00014