UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yRuhFVSkPo2GdLYS1Q5JWVIF4hNLBY8Pj8fj7w2mgpg='
WHERE
key_id = '6ec115bce4b255e27abbd5b12de44fb8e4e12554a028006273f29068509309e9'
AND (
token = 'yRuhFVSkPo2GdLYS1Q5JWVIF4hNLBY8Pj8fj7w2mgpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)