UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nzbJ1TDmryoiFuuxFGAWlVsicijBIUkRZDYNNZ3iEBM='
WHERE
key_id = '5f813cc69f17c8c5ff26708db9552b24d54a616882f7e3db4db2ef4208163b70'
AND (
token = 'nzbJ1TDmryoiFuuxFGAWlVsicijBIUkRZDYNNZ3iEBM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)