UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TO1T+bLP0rlbnK3nZh7uxsAnUacWwQBoMktqhZmQhKc='
WHERE
key_id = '6c5e908bc5a89ed62875b477ae3db8857295af59e69ed018add2551eb3110cff'
AND (
token = 'TO1T+bLP0rlbnK3nZh7uxsAnUacWwQBoMktqhZmQhKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)