UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HwuXIfJNl8wuMQDvNkGHMEA13mmIhEXuXUJiqQJsHAo='
WHERE
key_id = 'bfdf42f0ad0f6e77a11e6c1b5105b835419609ccbf7c74c6dfd0206bd31f6eff'
AND (
token = 'HwuXIfJNl8wuMQDvNkGHMEA13mmIhEXuXUJiqQJsHAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)