UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E/KxapSZp2FXf/fkfZaKzOK6DxSKWTuoGtHwLlwzIcY='
WHERE
key_id = 'd98d3b41f185be7aa018bc877478f1ce641b25f6341cf2707bc97a67818d4cb2'
AND (
token = 'E/KxapSZp2FXf/fkfZaKzOK6DxSKWTuoGtHwLlwzIcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)