UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7w2ujKK2mFqaNIHtYQOZW1jUMNmlEkk68TXT9wH3GME='
WHERE
key_id = '76587640f5cbc8caa7dd71730b5feb907e26a1b4e7307ed831a21761bc8ed77f'
AND (
token = '7w2ujKK2mFqaNIHtYQOZW1jUMNmlEkk68TXT9wH3GME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)