UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LU+mdsKo93lUdIdxjcYI8vW+8Z89NhPumkHqoff+zLo='
WHERE
key_id = '9689812c4839edb2c8ffb89c5d7a73177414057c39e92d078dc7ced25793e299'
AND (
token = 'LU+mdsKo93lUdIdxjcYI8vW+8Z89NhPumkHqoff+zLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)