UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vsua3cF/AY6S6Op7nH44KGi53NXLzuMOyjMUSC7ZijY='
WHERE
key_id = '4d034632a60359f85352ee425fe97dbb14a38376e6648e27a008d3732cf42f5e'
AND (
token = 'vsua3cF/AY6S6Op7nH44KGi53NXLzuMOyjMUSC7ZijY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)