UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lzzyAS4MdQPR+sAdOO0ti3hfXW5m96aEmurGGVH2DO0='
WHERE
key_id = 'b89ba1a156af1fd29064a53fc6343538d10ca85108a3a9651e39c2623ea848fd'
AND (
token = 'lzzyAS4MdQPR+sAdOO0ti3hfXW5m96aEmurGGVH2DO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)