UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm5CIoX4IoTh7dkinzl8mdJxJoCXfXlzAeHfeX/BWN5Y='
WHERE
key_id = 'd469da5757cc6f0e5f59e7fb912d73ec34b64b4c242e23f7781849c7d8cd062f'
AND (
token = 'm5CIoX4IoTh7dkinzl8mdJxJoCXfXlzAeHfeX/BWN5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)