UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dJiclHa/frTKTWyTL2DRmP3lFHM3cqvwi7ZRrqtAzsk='
WHERE
key_id = '383195a11e196325615585ce95f464a17577625caa5aa16368f2a61fb73ac622'
AND (
token = 'dJiclHa/frTKTWyTL2DRmP3lFHM3cqvwi7ZRrqtAzsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)