UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SFHBtjS0IaBOlRKj3ZTWxwiKvl2qbI2s0tQrXk7VcC8='
WHERE
key_id = '90a927222864cb5a8b0a8f8932542cd0cc4c61020a398d1f8e626b5f5a106b8e'
AND (
token = 'SFHBtjS0IaBOlRKj3ZTWxwiKvl2qbI2s0tQrXk7VcC8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)