UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/nUpVyrU/afD1Cwbm7ybRu/DgrU38IRPUaEtK7bCOF0='
WHERE
key_id = '0f887d701353f0d7e5f182b71e7791c32c8da82bf55e218b6202316e2cc33898'
AND (
token = '/nUpVyrU/afD1Cwbm7ybRu/DgrU38IRPUaEtK7bCOF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)