UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3xhTtlPl7Oy2g90/99QhvnRBBM7Mj1Cbx94ILGqMiW4='
WHERE
key_id = '6bd262f7a285953c71873d5569849f4811b33edfcd6c613a7afc5bcbcb84ef74'
AND (
token = '3xhTtlPl7Oy2g90/99QhvnRBBM7Mj1Cbx94ILGqMiW4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)