UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YOh8ta9WF5+n+3gmHfDG1kZn/9EVSZgbD4fqZ4IR6gM='
WHERE
key_id = '9a76a9c3ba5a9ff0c646cf2c5b44a3422ac7a371f2d3410f44a6f07e90ee8b03'
AND (
token = 'YOh8ta9WF5+n+3gmHfDG1kZn/9EVSZgbD4fqZ4IR6gM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)