UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6JmgKLbgdE+7bQ6/YPRDu9klxgaEC7mOlfJbS4SpVVE='
WHERE
key_id = '9dacb6ddcc9804150b6ab65f67dd7351a03b5de4cd85f0bfbfb63736e695a223'
AND (
token = '6JmgKLbgdE+7bQ6/YPRDu9klxgaEC7mOlfJbS4SpVVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)