UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'heYqiJ6BGXGk4DoZUmoe6oN7ykEM3uqrVEvS5ViU2sg='
WHERE
key_id = '0621778f243be5f475ce21bebe48a593afd7f9c12f7d11d216f08f791197f813'
AND (
token = 'heYqiJ6BGXGk4DoZUmoe6oN7ykEM3uqrVEvS5ViU2sg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)