UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CX8/utcMkGxpnOlHDk6SW9e9/kCSN9SYGuicdKFU9BQ='
WHERE
key_id = 'bcb9caa7e20078defc1128219655e0f431553909c8ce599fafb679ceb5ef5120'
AND (
token = 'CX8/utcMkGxpnOlHDk6SW9e9/kCSN9SYGuicdKFU9BQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)