UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B83zkOOaVo7NIiNf2yFczD6IrxlzXml2j7UStakyXrc='
WHERE
key_id = '9bcaeff77d4c6c1c8daef02d22115cf2dbab30a7135d72eef2eb9300a80d2294'
AND (
token = 'B83zkOOaVo7NIiNf2yFczD6IrxlzXml2j7UStakyXrc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)