UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WzdatpLEsm8g7IEPCBonQ+DRsV3U+iSIcuDd/HDyr5A='
WHERE
key_id = 'f4e7d3620fc87baa5a1af96a9b848741d5af9d16dc2e548d95cfcd2c5a22fdef'
AND (
token = 'WzdatpLEsm8g7IEPCBonQ+DRsV3U+iSIcuDd/HDyr5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)