UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DWSaGIylAbkRcZtFkVf3Iixs+SZWILyAX8HcNAbyPu0='
WHERE
key_id = 'd9d3cbc200925384b76f28c3054771080c493b98ffca11f7633954aa5e1e6076'
AND (
token = 'DWSaGIylAbkRcZtFkVf3Iixs+SZWILyAX8HcNAbyPu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)