UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rXB/uST4LjpgY82w7XnVQQWP3BCA4rSDWeojtNwyjjk='
WHERE
key_id = '5e41b1f14480a3d0b98fb57aeef5d0a15a31466f466a49349d88c818590b81a4'
AND (
token = 'rXB/uST4LjpgY82w7XnVQQWP3BCA4rSDWeojtNwyjjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)