UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jEhRemag7H3ZxNiZbqaYsyopx1pp3tQrZBbQ7qH1/c4='
WHERE
key_id = '252498c09e612d24e0e7a569af06b0ac8a57ae035c37176831c586c6a461e46c'
AND (
token = 'jEhRemag7H3ZxNiZbqaYsyopx1pp3tQrZBbQ7qH1/c4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)