UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w221N6j58oTwHl6ytVyenbDDahMXDp01Y/wLTcHDJk8='
WHERE
key_id = '4b08b8cd03e59537ec792703025f2da7651a61f7b0a409e724e232cadf9e228f'
AND (
token = 'w221N6j58oTwHl6ytVyenbDDahMXDp01Y/wLTcHDJk8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)