UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/lLpACBdDXTmVwfER8CPB19MSYK1qm3vPgG74Oh/uL8='
WHERE
key_id = '4396430a33e304c6f870bc4ca73fae786dabb4ee27df1c24a6ba7264de33b3b4'
AND (
token = '/lLpACBdDXTmVwfER8CPB19MSYK1qm3vPgG74Oh/uL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)