UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sZPTRuDFfBJDH40tL0TDMsLHct4Q+R77VxBknPeEFj0='
WHERE
key_id = 'f881289c781129ac11cdc0a4184328672ffbdce785a2640cbf706802ac72547d'
AND (
token = 'sZPTRuDFfBJDH40tL0TDMsLHct4Q+R77VxBknPeEFj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)