UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UjE3gHTbR/BLihDQe1USfTp/VLnA1UwvIPKV5Yl1hDA=' 
WHERE 
  key_id = 'd421186306d93a01a4bf5c9ea00a1089381616760c5847dc3dab1032747d0c1f' 
  AND (
    token = 'UjE3gHTbR/BLihDQe1USfTp/VLnA1UwvIPKV5Yl1hDA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055