UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D2zJaKrCWGwGTS7LEVwz859yxKGwFqHkOe+PSFwMjpw='
WHERE
key_id = 'eb1e564358f861da07c0bf7e3a6c2cea8471746c6ca428fb33f1c7a4ab4794a9'
AND (
token = 'D2zJaKrCWGwGTS7LEVwz859yxKGwFqHkOe+PSFwMjpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)