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