UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tSFaejqoaOrdvpW53P0W4fx4vE7ny/BRri0XHvd6LgA='
WHERE
key_id = '10eeddc54372e917765fb558ba2d089b7e4d1d2c69198ef37bc77c6773669533'
AND (
token = 'tSFaejqoaOrdvpW53P0W4fx4vE7ny/BRri0XHvd6LgA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)