UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3mwKt+KNlMJBrV8ifEc/2cFymv7vdMkDEhYeuS/BMrA='
WHERE
key_id = 'e365c786a0f5b46b40608f310be34887bf69e9b017f3322eaee3c733061c9fea'
AND (
token = '3mwKt+KNlMJBrV8ifEc/2cFymv7vdMkDEhYeuS/BMrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)