UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YeVS2UtF4ZIYS/nyc3kKldD/Y0MKtA9L+TZ04Ktuje4='
WHERE
key_id = 'aafdc52b2f12f8135fec174e4d304a2bb64b0297e2d55f333a28edc11ac5881d'
AND (
token = 'YeVS2UtF4ZIYS/nyc3kKldD/Y0MKtA9L+TZ04Ktuje4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)