UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LgbmM+tKlCMJytb2GYB4aEYRk0qiKCctZHjhO0IyKtw='
WHERE
key_id = '033a3221c893dea73f330b656496140e19756e862321f2581f86bc4a564c33f8'
AND (
token = 'LgbmM+tKlCMJytb2GYB4aEYRk0qiKCctZHjhO0IyKtw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)